package com.spring5.learning.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author xin
 * @version 1.0
 */
@Component
public class Person {

    @Value("${person.name}")
    private String name;

    @Value("${person.sex}")
    private String sex;


    @Autowired
    private Dog dog;

    @Autowired
    private DogService dogService;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Dog getDog() {
        return dog;
    }

    public void setDog(Dog dog) {
        this.dog = dog;
    }


    public void walkDog() {
        dogService.walk(dog);
    }
}
